<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位</title>
</head>
<style>
    .child {
        height: 60px;
        width: 60px;
        border: 1px solid #333;
        /* 边框圆角 */
        border-radius: 100%;
        /* 文字水平居中 */
        text-align: center;
        /* 文字垂直居中 */
        line-height: 60px;
        /* 元素的水平垂直居中 */
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        /* top: 50%;
        margin-top: -30px;
        left: 50%;
        margin-left: -30px; */
    }
    .parent {
        height: 200px;
        width: 200px;
        margin-top: 100px;
        background-color: pink;
        position: relative;
    }
</style>
<body>
    <div class="parent">
        <div class="child">子节点</div>
    </div>
</body>
</html>